package org.dtrd.modules.record.entity.bean;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.dtrd.common.util.DateUtils;
import org.dtrd.modules.record.entity.po.DtrdEntRdSigninSleep;

import java.util.Date;

/**
 * @Author QR
 * @Date 2021/11/3 5:11 PM
 */
@ApiModel("睡眠记录数据对象")
@Data
public class SleepBean {

    @ApiModelProperty("记录id")
    private Integer dataId;

    @ApiModelProperty("患者id")
    private Integer patientId;

    @ApiModelProperty("记录时间")
    private String recordTime;

    @ApiModelProperty("睡眠状况, 1-正常, 2-早睡,3-晚睡,4-失眠")
    private Integer SleepStatus;

    @ApiModelProperty("睡眠描述")
    private String SleepDescribe;

    @ApiModelProperty("睡眠备注")
    private String sleepRemark;

    private String recordPhoto;

    public SleepBean() {
    }

    public SleepBean(Integer patientId, Date date, Integer type) {
        this.patientId = patientId;
        this.recordTime = DateUtils.formatDate(date, DateUtils.datetimeFormat.get().toPattern());
        this.SleepStatus = type;
    }

    public SleepBean(DtrdEntRdSigninSleep po) {
        this.dataId = po.getDataId();
        this.patientId = po.getPatientId();
        this.recordTime = DateUtils.formatDate(po.getRecordTime(), DateUtils.datetimeFormat.get().toPattern());
        this.SleepStatus = po.getSleepStatus();
        this.SleepDescribe = po.getSleepDescribe();
        this.sleepRemark = po.getSleepRemark();
        recordPhoto = po.getRecordPhoto();

    }
}
